<!--{eval
	$_G['home_tpl_titles'] = array($blog['subject'], '{lang blog}');
	$_G['home_tpl_spacemenus'][] = "<a href=\"home.php?mod=space&username=$space[username]&do=$do&view=me\">{lang they_blog}</a>";
	$_G['home_tpl_spacemenus'][] = "<a href=\"home.php?mod=space&username=$space[username]&do=blog&id=$blog[blogid]\">{lang view_blog}</a>";
	$friendsname = array(1 => '{lang friendname_1}',2 => '{lang friendname_2}',3 => '{lang friendname_3}',4 => '{lang friendname_4}');
}-->
<!--{eval $pageview = '<a href="home.php?mod=space&username=' .$space[username] . '&do=blog">' . lang("home/template","blog") . '</a>';}-->
<!--{template home/space_header}-->
<!--{template home/space_site_left}-->
<div style="padding-left:10px;">
<!--{subtemplate home/space_short_profile}-->
</div>
<div class="bm z" style="width:770px;">
    <div style="padding-left:10px;">
        <!--{if $space[self]}--><span class="xi2 y"><a href="home.php?mod=spacecp&ac=blog" class="addnew">{lang post_new_blog}</a></span><!--{/if}-->
        <h1 style="font-size: 15px;{if $blog[magiccolor]} color: {$_G[colorarray][$blog[magiccolor]]}{/if}">
            $blog[subject]
            <!--{if $blog[status] == 1}-->
                <span class="xi1">({lang pending})</span>
            <!--{/if}-->
        </h1>
        <!--{hook/space_blog_title}-->
    </div>
    <div class="bm_c">
        <div class="vw">
            <div id="blog_article" class="d cl">
                <!--{ad/blog/a_b}-->
                $blog[message]
            </div>
            <!--{if $blog[friend] != 3 && !$blog[noreply]}-->
            <div id="click_div">
                <!--{template home/space_click}-->
            </div>
            <!--{/if}-->
            <div class="o cl">
                <a href="home.php?mod=spacecp&ac=favorite&type=blog&id=$blog[blogid]&spaceuid=$blog[uid]&handlekey=favoritebloghk_{$blog[blogid]}" id="a_favorite" onclick="showWindow(this.id, this.href, 'get', 0);" class="oshr ofav">{lang favorite}</a>
                <a href="home.php?mod=spacecp&ac=share&type=blog&id=$blog[blogid]&handlekey=sharebloghk_{$blog[blogid]}" id="a_share" onclick="showWindow(this.id, this.href, 'get', 0);" class="oshr">{lang share}</a>
                <!--{if ($_G[uid] == $blog[uid]) && $_G[setting][magicstatus] && ($_G[setting][magics][call] || $_G[setting][magics][updateline] || $_G[setting][magics][downdateline] || $_G[setting][magics][hot] || $_G[setting][magics][highlight])}-->
                    <a href="javascript:;" id="usemagic" onmouseover="showMenu(this.id);">{lang use_magic_tools}</a>
                    <span class="pipe">|</span>
                    <ul id="usemagic_menu" class="p_pop mgcmn" style="display:none;">
                        <!--{if $_G[setting][magics][call]}-->
                        <li><a href="home.php?mod=magic&mid=call&idtype=blogid&id=$blog[blogid]" id="a_magic_call" onclick="showWindow('magics', this.href, 'get', 0);"><img src="{STATICURL}image/magic/call.small.gif" alt="call" class="vm" /> {$_G[setting][magics][call]}</a></li>
                        <!--{/if}-->
                        <!--{if $_G[setting][magics][updateline]}-->
                        <li><a href="home.php?mod=magic&mid=updateline&idtype=blogid&id=$blog[blogid]" id="a_magic_updateline" onclick="showWindow('magics', this.href, 'get', 0);"><img src="{STATICURL}image/magic/updateline.small.gif" alt="updateline" class="vm" /> {$_G[setting][magics][updateline]}</a></li>
                        <!--{/if}-->
                        <!--{if $_G[setting][magics][downdateline]}-->
                        <li><a href="home.php?mod=magic&mid=downdateline&idtype=blogid&id=$blog[blogid]" id="a_magic_downdateline" onclick="showWindow('magics', this.href, 'get', 0);"><img src="{STATICURL}image/magic/downdateline.small.gif" alt="downdateline" class="vm" /> {$_G[setting][magics][downdateline]}</a></li>
                        <!--{/if}-->
                        <!--{if $_G[setting][magics][hot]}-->
                        <li><a href="home.php?mod=magic&mid=hot&idtype=blogid&id=$blog[blogid]" id="a_magic_hot" onclick="showWindow('magics', this.href, 'get', 0);"><img src="{STATICURL}image/magic/hot.small.gif" alt="hot" class="vm" /> {$_G[setting][magics][hot]}</a></li>
                        <!--{/if}-->
                        <!--{if $_G[setting][magics][highlight]}-->
                        <li><a href="home.php?mod=magic&mid=highlight&idtype=blogid&id=$blog[blogid]" id="a_magic_highlight" onclick="showWindow('magics', this.href, 'get', 0);"><img src="{STATICURL}image/magic/highlight.small.gif" alt="hot" class="vm" /> {$_G[setting][magics][highlight]}</a></li>
                        <!--{/if}-->
                    </ul>
                <!--{/if}-->

                <!--{hook/space_blog_op_extra}-->
                <!--{if $_G[uid] == $blog[uid] || checkperm('manageblog')}-->
                <a href="home.php?mod=spacecp&ac=blog&blogid=$blog[blogid]&op=edit">{lang edit}</a><span class="pipe">|</span>
                <a href="home.php?mod=spacecp&ac=blog&blogid=$blog[blogid]&op=delete&handlekey=delbloghk_{$blog[blogid]}" id="blog_delete_$blog[blogid]" onclick="showWindow(this.id, this.href, 'get', 0);">{lang delete}</a><span class="pipe">|</span>
                <!--{/if}-->

                <!--{if checkperm('manageblog')}-->
                IP: $blog[postip]<span class="pipe">|</span>
                <a href="home.php?mod=spacecp&ac=blog&blogid=$blog[blogid]&op=edithot&handlekey=bloghothk_{$blog[blogid]}" id="blog_hot_$blog[blogid]" onclick="showWindow(this.id, this.href, 'get', 0);">{lang hot}</a><span class="pipe">|</span>
                <!--{/if}-->

                <!--{if !$blog['friend'] && !$blog['pushedaid'] && (getstatus($_G['member']['allowadmincp'], 2) || $_G['group']['allowmanagearticle'])}-->
                <a href="portal.php?mod=portalcp&ac=index&op=push&idtype=blogid&id=$blog[blogid]" onclick="showWindow('push', this.href, 'get', 0)">{lang article_push}</a><span class="pipe">|</span>
                <!--{/if}-->

                <!--{if $_G['group']['allowdiy'] || getstatus($_G['member']['allowadmincp'], 4) || getstatus($_G['member']['allowadmincp'], 5) || getstatus($_G['member']['allowadmincp'], 6)}-->
                    <a href="portal.php?mod=portalcp&ac=portalblock&op=recommend&idtype=blogid&id=$blog[blogid]" onclick="showWindow('recommend', this.href, 'get', 0)">{lang blockdata_recommend}</a><span class="pipe">|</span>
                <!--{/if}-->
                <!--{if $_G['uid'] != $blog['uid']}-->
                <a href="javascript:;" onclick="showWindow('miscreport$blog[blogid]', 'misc.php?mod=report&rtype=blog&uid=$blog[uid]&rid=$blog[blogid]', 'get', -1);return false;">{lang report}</a>
                <!--{/if}-->
            </div>
			<div style="padding-top:10px;">
            	<p class="xg2">
                    <!--{if $blog['friend']}-->
                    <span class="y">{$friendsname[$blog[friend]]}</span>
                    <!--{/if}-->
                    <!--{if $blog[hot]}--><strong class="hot">{lang hot} <em>$blog[hot]</em></strong><!--{/if}-->
                    <!--{if $blog['friend']}-->
                    <span class="y"><a href="home.php?mod=space&username=$space[username]&do=$do&view=me&friend=$blog[friend]" class="xg1">{$friendsname[$value[friend]]}</a></span>
                    <!--{/if}-->
                    <!--{if $blog[viewnum]}--><span class="xg1">{lang have_read_blog}</span><!--{/if}-->
                    <span class="pipe">|</span><span class="xg1">{lang postime}: <!--{date($blog[dateline])}--></span>
                <!--{if $classarr[classname]}--><span class="pipe">|</span><span class="xg1">{lang personal_category}:<a href="home.php?mod=space&uid=$blog[uid]&do=blog&classid=$blog[classid]&view=me">{$classarr[classname]}</a></span><!--{/if}-->
                <!--{if $blog[catname]}--><span class="pipe">|</span><span class="xg1">{lang system_cat}:<a href="home.php?mod=space&do=blog&view=all&catid=$blog[catid]">$blog[catname]</a></span><!--{/if}-->
                <!--{if $blog[tag]}-->
                    <span class="pipe">|</span>
                    <span class="ptg xg1">
                        <!--{eval $tagi = 0;}-->
                        <!--{loop $blog[tag] $var}-->
                            <!--{if $tagi}-->, <!--{/if}--><a href="misc.php?mod=tag&id=$var[0]">$var[1]</a>
                            <!--{eval $tagi++;}-->
                        <!--{/loop}-->
                    </span>
                <!--{/if}-->
                </p>
            </div>
        </div>
        <!--{if $blog[friend] != 3 && !$blog[noreply]}-->
        <div id="click_div">
            <!--{template home/space_click}-->
        </div>
        <!--{/if}-->
        <div class="cmt hcmd">
            <i class="x-nhot"></i>
            <div class="xld xlda">
                <h3 class="ptn pbn bbs ">
                    <!--{if !$blog[noreply] && $_G['uid']}-->
                    <a href="home.php?mod=space&uid=$blog[uid]&do=$do&id=$id#quickcommentform_{$id}" onclick="if($('comment_message')){$('comment_message').focus();return false;}" class="y xi2 xw0">{lang publish_comment}</a>
                    <!--{/if}-->
                    {lang comment} (<span id="comment_replynum">$blog[replynum]</span> {lang blog_replay})
                </h3>
            </div>
            <div id="div_main_content" class="mbm">
                <div id="comment_ul" class="xld xlda">
                <!--{eval $lastcid = 0;}-->
                <!--{loop $list $k $value}-->
                    <!--{template home/space_comment_li}-->
                    <!--{eval $lastcid = $value['cid'];}-->
                <!--{/loop}-->
                </div>
            </div>
            <!--{if !$blog[noreply] && $_G['uid']}-->
            <table cellpadding="0" width="100%">
                <tr>
                    <td valign="top" width="50px">
                        <div class="avt">
                            <a href="home.php?mod=space&uid=$_G['uid']" class="avt_l" c="1">
                                <!--{avatar($_G['uid'],small)}-->
                            </a>
                        </div>
                    </td>
                    <td width="*">
            <form id="quickcommentform_{$id}" action="home.php?mod=spacecp&ac=comment" method="post" autocomplete="off" onsubmit="ajaxpost('quickcommentform_{$id}', 'return_qcblog_$id');doane(event);">
             <p>
                <span id="comment_face" title="{lang insert_emoticons}"  onclick="showFace(this.id, 'comment_message');return false;" class="cur1"><img src="{IMGDIR}/facelist.gif" alt="facelist" class="vm" /></span>
                <!--{hook/space_album_face_extra}-->
                <!--{if $_G['setting']['magicstatus'] && !empty($_G['setting']['magics']['doodle'])}-->
                <a id="a_magic_doodle" href="home.php?mod=magic&mid=doodle&showid=comment_doodle&target=comment_message" onclick="showWindow(this.id, this.href, 'get', 0)"><img src="{STATICURL}image/magic/doodle.small.gif" alt="doodle" class="vm" title="$_G['setting']['magics']['doodle']" /></a>
                <!--{/if}-->
            </p>
            <textarea id="comment_message" onkeydown="ctrlEnter(event, 'commentblogsubmit_btn');  resizeTx(this);" onfocus="txtTxCommentChk(this.id, 1)" onblur="onckeydown=true; resizeTx(this); txtTxCommentChk(this.id, 2)" name="message" rows="1"  class="pts"  style="color:#CCC;">Viết bình luận...</textarea>
            <!--{if checkperm('seccode') && ($secqaacheck || $seccodecheck)}-->
                <!--{block sectpl}--><sec> <span id="sec<hash>" onclick="showMenu(this.id);"><sec></span><div id="sec<hash>_menu" class="p_pop p_opt" style="display:none"><sec></div><!--{/block}-->
                <div class="mtm mbm sec"><!--{subtemplate common/seccheck}--></div>
            <!--{/if}-->
            <p class="pns">
                    <input type="hidden" name="referer" value="home.php?mod=space&uid=$blog[uid]&do=$do&id=$id" />
                    <input type="hidden" name="id" value="$id" />
                    <input type="hidden" name="idtype" value="blogid" />
                    <input type="hidden" name="handlekey" value="qcblog_{$id}" />
                    <input type="hidden" name="commentsubmit" value="true" />
                    <input type="hidden" name="quickcomment" value="true" />
                    <button type="submit" name="commentblogsubmit_btn" value="true" id="commentblogsubmit_btn" style="display:none" class="pn"{if !$_G[uid]} onclick="showWindow(this.id, this.form.action);return false;"{/if}><strong>{lang comment}</strong></button>
                    <span id="return_qcblog_{$id}"></span>
                </p>
                <input type="hidden" name="formhash" value="{FORMHASH}" />
            </form>
            </td>
                </tr>
            </table>
            <!--{/if}-->
    	</div>
         <!--{if $multi}--><div class="pgs cl mbm">$multi</div><!--{/if}-->
    </div>
</div>
<div class="y column" style="width:225px;">
		<!--{if $newlist}-->
        <div class="bm block move-span">
    		<div class="blocktitle title">
                <span>{lang popular_blog_review}</span>  
            </div>
            <div class="bm_l woo-mr-bt">
                <ul class="xl bxm cl">
                    <!--{loop $newlist $value}-->
                    <li><span class="xl1_elp">&bull; <a href="home.php?mod=space&uid=$value[uid]&do=blog&id=$value[blogid]">$value[subject]</a></span></li>
                    <!--{/loop}-->
                </ul>
            </div>
        </div>    
        <!--{/if}-->
        <!--{if $otherlist}-->
        <div class="bm block move-span">
    		<div class="blocktitle title">
                <span>{lang author_newest_blog}</span>
                <span class="y xw0">
                    <a href="home.php?mod=space&uid=$blog[uid]&do=blog&view=me">{lang all}</a>
                </span>  
            </div>
            <div class="bm_l woo-mr-bt">
        		<ul class="xl bxm cl">      
                <!--{loop $otherlist $value}-->
                    <li>&bull; <a href="home.php?mod=space&uid=$value[uid]&do=blog&id=$value[blogid]">$value[subject]</a></li>
                <!--{/loop}-->
                </ul>
        	 </div>
        </div>
        <!--{/if}-->
<!--{subtemplate common/ads_right}-->
</div>
<!--{template home/space_site_right}-->

<script type="text/javascript">
	var blogid_lastcid	= $lastcid;
	var blog_id			= $id;
	var blog_viewautoload_$id = null;
	
	function _blog_viewautoload_$id(){
		return setInterval(function(){comment_autoload('comment_ul', 'blog');}, 10000);
	}
	jQuery(document).ready(function(){
		blog_viewautoload_$id = _blog_viewautoload_$id();
	});
	
	function succeedhandle_qcblog_$id(url, msg, values) {
		if(values['cid']) {
			if($('comment_message')) {
				$('comment_message').value= '';
			}
			blog_viewautoload_$id = window.clearInterval(blog_viewautoload_$id);
			comment_autoload('comment_ul', 'blog');
			blog_viewautoload_$id = _blog_viewautoload_$id();
			setTimeout(function(){
				$('return_qcblog_{$id}').innerHTML = '';
			}, 3000);
		} else {
			$('return_qcblog_{$id}').innerHTML = msg;
		}
		<!--{if checkperm('seccode') && $sechash}-->
			<!--{if $secqaacheck}-->
			updatesecqaa('$sechash');
			<!--{/if}-->
			<!--{if $seccodecheck}-->
			updateseccode('$sechash');
			<!--{/if}-->
		<!--{/if}-->
	}
	function addFriendCall(){
		var el = $('friendinput');
		if(!el || el.value == "")	return;
		var s = '<input type="checkbox" name="fusername[]" class="pc" value="'+el.value+'" id="'+el.value+'" checked="checked">';
		s += '<label for="'+el.value+'">'+el.value+'</label>';
		s += '<br />';
		$('friendscall').innerHTML += s;
		el.value = '';
	}
	resizeImg('div_main_content','450');
	var elems = selector('dd[class~=magicflicker]');
	for(var i=0; i<elems.length; i++){
		magicColor(elems[i]);
	}
	<!--{if $_G['relatedlinks']}-->
	var relatedlink = [];
	<!--{loop $_G['relatedlinks'] $key $link}-->
	relatedlink[$key] = {'sname':'$link[name]', 'surl':'$link[url]'};
	<!--{/loop}-->
	relatedlinks('blog_article');
	<!--{/if}-->
	<!--{if !empty($_G['cookie']['clearUserdata']) && $_G['cookie']['clearUserdata'] == 'home'}-->
	saveUserdata('home', '')
	<!--{/if}-->
</script>

<!--{template common/footer}-->
